package gemini.basic.model;
// default package
// Generated Nov 23, 2010 4:23:01 PM by Hibernate Tools 3.4.0.Beta1

import static javax.persistence.GenerationType.IDENTITY;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import javax.persistence.Version;

/**
 * DiscountScale generated by hbm2java
 */
@Entity
@Table(name = "g_discount_scale", catalog = "gemini", uniqueConstraints = @UniqueConstraint(columnNames = "code"))
public class DiscountScale extends AbstractDomain implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	
	private Integer id;
	private Integer version;
	private String code;
	private short value;
	private List<BuyOrder> buyOrders = new ArrayList<BuyOrder>(0);
	private List<Price> prices = new ArrayList<Price>(0);


	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Version
	@Column(name = "version")
	public Integer getVersion() {
		return this.version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}

	@Column(name = "code", nullable = false, length = 5)
	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	@Column(name = "value", nullable = false)
	public short getValue() {
		return this.value;
	}

	public void setValue(short value) {
		this.value = value;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "discountScale")
	public List<BuyOrder> getBuyOrders() {
		return this.buyOrders;
	}

	public void setBuyOrders(List<BuyOrder> buyOrders) {
		this.buyOrders = buyOrders;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "discountScale")
	public List<Price> getPrices() {
		return this.prices;
	}

	public void setPrices(List<Price> prices) {
		this.prices = prices;
	}
}
